<template>
  <div class="container">
    <div class="head">
      <div class="module-tit">活动时间</div>
    </div>
    <div class="body">
      <el-form label-width="150px">
      <el-form-item class="shopItem" label="活动开始时间：">
        <el-date-picker
          value-format="yyyy-MM-dd HH:mm:ss"
          v-model="dataForm.startTime"
          type="datetime"
          placeholder="选择开始日期时间"
          size="small">
        </el-date-picker>
      </el-form-item>
      <el-form-item class="shopItem" label="活动结束时间：">
        <el-date-picker
          value-format="yyyy-MM-dd HH:mm:ss"
          v-model="dataForm.endTime"
          type="datetime"
          placeholder="选择结束日期时间"
          size="small">
        </el-date-picker>
      </el-form-item>
      </el-form>
    </div>
    <div class="head">
      <div class="module-tit">参与设置</div>
    </div>
    <div class="body">
      <el-form label-width="150px">
      <el-form-item class="shopItem" label="单人总参与次数：">
        <el-input size="small" v-model="dataForm.luckNumber"></el-input>
      </el-form-item>
      <el-form-item class="shopItem" label="每人每日参与次数：">
        <el-input size="small" v-model="dataForm.dayLuckNumber"></el-input>
      </el-form-item>
      </el-form>
    </div>
    <div class="head">
      <div class="module-tit">中奖设置</div>
    </div>
    <div class="body">
      <el-form label-width="150px">
      <el-form-item class="shopItem" label="单人总中奖次数：">
        <el-input size="small" v-model="dataForm.winningTime"></el-input>
      </el-form-item>
      <el-form-item class="shopItem" label="每人每日中奖次数：">
        <el-input size="small" v-model="dataForm.dayWinningTime"></el-input>
      </el-form-item>
      </el-form>
    </div>
    <el-button @click="save" type="primary">保存设置</el-button>
    <!-- <div class="head">
      <div class="module-tit">活动提示</div>
    </div>
    <div class="body">
      <el-form label-width="150px">
      <el-form-item class="shopItem" label="未中奖提示：">
        <el-input size="small" ></el-input>

      </el-form-item>
      <el-form-item class="shopItem" label="总次数上限：">
        <el-input size="small" ></el-input>
      </el-form-item>
      <el-form-item class="shopItem" label="日次数上限：">
        <el-input size="small" ></el-input>
      </el-form-item>
      </el-form>
    </div> -->


            

	</div>
</template>>

<script>

export default {
  data(){
    return {
      updateVisible: false,
      introVisible: false,
      dataForm: {
        startTime :null,
        endTime :null,
        luckNumber :null,
        dayLuckNumber :null,
        dayWinningTime :null,
        winningTime :null,
        id: null,
      },
      resourcesUrl: window.SITE_CONFIG.resourcesUrl
    }
  },

  computed:{
  },

  components:{
  },

  methods:{
    getLuckprodInfo(){
      this.$http({
        url: this.$http.adornUrl('/luckUser/getLuckInformation'),
        method: 'post',
      }).then(({data}) =>{
        console.log(data)
        this.dataForm.id = data.id,
        this.dataForm.startTime = data.startTime,
        this.dataForm.endTime = data.endTime,
        this.dataForm.luckNumber = data.luckNumber,
        this.dataForm.dayLuckNumber = data.dayLuckNumber,
        this.dataForm.dayWinningTime = data.dayWinningTime,
        this.dataForm.winningTime = data.winningTime
      })
    },

    save(){
      this.$http({
        url: this.$http.adornUrl('/luckUser/update'),
        method: 'post',
        params: this.$http.adornParams({
          startTime: this.dataForm.startTime,
          endTime: this.dataForm.endTime,
          luckNumber: this.dataForm.luckNumber,
          dayLuckNumber: this.dataForm.dayLuckNumber,
          dayWinningTime: this.dataForm.dayWinningTime,
          winningTime: this.dataForm.winningTime,
          id: this.dataForm.id
        })
      }).then((res) =>{
        console.log(res)
      })
    },
  },

  created(){
    this.getLuckprodInfo()
  },



}
</script>

<style scoped>
div{
  padding: 0;
  margin: 0;
}
.container{
  height: 100%;
  width: 100%;
  margin-bottom: 30px;
}
.container .head{
  /* height: 30px; */
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  padding: 30px 15px 20px;
}
.container .head .module-tit{
  font-size: 17px;
  color: #21252F;
  font-weight: 550;
}
.container .head .module-tit::before{
  content: '';
  border-right: 3px solid #0087EB;
  margin-right: 5px;
}
.container .head .update{
  border: 1px solid #46A3F1;
  font-size: 12px;
  height: 27px;
  line-height: 27px;
  width: 60px;
  border-radius: 4px;
  text-align: center;
  color: #46a3f1;
  cursor: pointer;
}
.container .body{
  margin-left: 20px;
}
.container .body .shopItem{
  margin: 0px 0;
}
.container .body .shopItem >>> .el-input{
  width: 200px;
}


</style>